//class ListCell
package baidu.ui.controls.list
{
    import baidu.ui.controls.*;
    import flash.events.*;

    public class ListCell extends baidu.ui.controls.LabelButton implements baidu.ui.controls.list.IListCell
    {
        public function ListCell()
        {
            super();
            toggle = true;
            return;
        }

        public override function get classStyles():Object
        {
            return mergeStyles(super.classStyles, defaultStyles);
        }

        protected override function toggleSelected(arg1:flash.events.MouseEvent):void
        {
            return;
        }

        public function get data():*
        {
            return this._data;
        }

        public function set data(arg1:*):void
        {
            this._data = arg1;
            label = this._data.label;
            icon = this._data.icon;
            return;
        }

        public function get listData():baidu.ui.controls.list.ListData
        {
            return this._listData;
        }

        public function set listData(arg1:baidu.ui.controls.list.ListData):void
        {
            this._listData = arg1;
            return;
        }

        protected override function drawLayout():void
        {
            var loc3:*;
            loc3 = NaN;
            var loc1:*;
            loc1 = Number(getStyleValue("padding"));
            var loc2:*;
            loc2 = 0;
            if (_icon != null)
            {
                _icon.x = loc1;
                _icon.y = Math.round((_height - _icon.height) / 2);
                loc2 = _icon.width + loc1;
            }
            if (label.length > 0)
            {
                textField.visible = true;
                loc3 = Math.max(0, _width - loc2 - loc1 * 2);
                textField.width = loc3;
                textField.height = textField.textHeight + 4;
                textField.x = loc2 + loc1;
                textField.y = Math.round((_height - textField.height) / 2);
            }
            else
            {
                textField.visible = false;
            }
            background.width = _width;
            background.height = _height;
            return;
        }


        {
            defaultStyles = {"skin":"ListCell_Skin", "iconSkin":null};
        }

        protected var _data:*;

        protected var _listData:baidu.ui.controls.list.ListData;

        public static var defaultStyles:Object;
    }
}


